import { ListColumns } from "@/api/interface/ListColumns";
import { EditColumns } from "@/api/interface/EditColumns";
import { requestSysDictionaryGetOptions } from "@/api/modules/sysDictionary";
	
	
	import { defaultUploadProps } from "@/components/FormCreate/defaultProps/upload";
	
	import { getDicOptions } from "@/components/FormCreate/request";
	
	
	import { getDicOptions } from "@/components/FormCreate/request";
	
	
	


//data.ts 该文件为自动生成，每次生成都会进行覆盖，请不要动该文件
export namespace SysUser {
//字段名称enum
export enum Fields {
	id="id",
	avatar="avatar",
	username="username",
	sex="sex",
	password="password",
	role_ids="role_ids",
	status="status",
	creator="creator",
	created_at="created_at",
	updated_at="updated_at",

}

//[列表]字段配置数据列表
export const listColumnsData: ListColumns = new ListColumns(
{ type: "selection", fixed: "left", width: 70 },
	{ prop: "id", label: "ID",  align: "",isShow: true,tag: false },
	{ prop: "avatar", label: "头像",  align: "",isShow: true,tag: false },
	{ prop: "username", label: "用户名",  align: "",isShow: true,tag: false },
	{ prop: "sex", label: "性别",  align: "",isShow: true,tag: false ,enum: () => requestSysDictionaryGetOptions("sex")},
	{ prop: "role_ids", label: "所属角色列表",  align: "",isShow: true,tag: false },
	{ prop: "status", label: "状态",  align: "",isShow: true,tag: false ,enum: () => requestSysDictionaryGetOptions("user_status")},
	{ prop: "creator", label: "创建人id",  align: "",isShow: true,tag: false },
	{ prop: "created_at", label: "创建时间",  align: "",isShow: true,tag: false },
	{ prop: "updated_at", label: "更新时间",  align: "",isShow: true,tag: false },


{prop: "operation", label: "操作", fixed: "right"}
);

//[创建]表单列默认配置
export const CreateColumnsData: EditColumns = new EditColumns(
	{ type: "upload", title: "头像", col:{ span:12 }, field: "avatar", effect:{},props: defaultUploadProps('image',false),validate:[{required: true, message: "必填项：头像(字符串类型)" }] },
	{ type: "input", title: "用户名", col:{ span:12 }, field: "username", effect:{},props: {},validate:[{required: true, message: "必填项：用户名(字符串类型)" }] },
	{ type: "select", title: "性别", col:{ span:12 }, field: "sex", effect:{fetch: getDicOptions("sex")},props: {},validate:[{required: true, message: "必填项：性别" }] },
	{ type: "input", title: "密码", col:{ span:12 }, field: "password", effect:{},props: {},validate:[{required: true, message: "必填项：密码(字符串类型)" }] },
	{ type: "input", title: "所属角色列表", col:{ span:12 }, field: "role_ids", effect:{},props: {},validate:[] },
	{ type: "select", title: "状态", col:{ span:12 }, field: "status", effect:{fetch: getDicOptions("user_status")},props: {},validate:[{required: true, message: "必填项：状态" }] },
	{ type: "number", title: "创建人id", col:{ span:12 }, field: "creator", effect:{},props: {},validate:[] },

);

//[修改]表单列默认配置
export const UpdateColumnsData: EditColumns = new EditColumns(
	{ type: "hidden", title: "ID", col:{ span:12 }, field: "id", effect:{},props: {},validate:[{required: true, message: "必填项：ID(数字类型)" }] },
	{ type: "upload", title: "头像", col:{ span:12 }, field: "avatar", effect:{},props: defaultUploadProps('image',false),validate:[{required: true, message: "必填项：头像(字符串类型)" }] },
	{ type: "input", title: "用户名", col:{ span:12 }, field: "username", effect:{},props: {},validate:[{required: true, message: "必填项：用户名(字符串类型)" }] },
	{ type: "select", title: "性别", col:{ span:12 }, field: "sex", effect:{fetch: getDicOptions("sex")},props: {},validate:[{required: true, message: "必填项：性别" }] },
	{ type: "input", title: "密码", col:{ span:12 }, field: "password", effect:{},props: {},validate:[{required: true, message: "必填项：密码(字符串类型)" }] },
	{ type: "input", title: "所属角色列表", col:{ span:12 }, field: "role_ids", effect:{},props: {},validate:[] },
	{ type: "select", title: "状态", col:{ span:12 }, field: "status", effect:{fetch: getDicOptions("user_status")},props: {},validate:[{required: true, message: "必填项：状态" }] },
	{ type: "number", title: "创建人id", col:{ span:12 }, field: "creator", effect:{},props: {},validate:[] },

);
}

